//
//  ImageTools.h
//  ToolsSummary
//
//  Created by unisedu on 15/7/29.
//  Copyright (c) 2015年 unisedu. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@interface BKImageTools : NSObject
#pragma mark - 未知
+ (void)drawRoundedRect:(CGRect)rrect inContext:(CGContextRef)context withRadius:(CGFloat)radius;
//压缩图片
+ (UIImage*)imageWithImageSimple:(UIImage*)image scaledToSize:(CGSize)newSize;
//质量和尺寸循环压缩到想要的大小
+(UIImage *)compressImage:(UIImage *)image toByte:(NSUInteger)maxLength;
#pragma mark 屏幕截图并保存到相册
+ (UIImage*)saveImageFromView:(UIView*)view;
+ (void)savePhotosAlbum:(UIImage *)image;
+ (void)saveImageFromToPhotosAlbum:(UIView*)view;
- (void)imageSavedToPhotosAlbum:(UIImage *)image didFinishSavingWithError:(NSError *)error contextInfo:(void *) contextInfo;




// 根据图片url获取图片尺寸
+(CGSize)getImageSizeWithURL:(id)imageURL;
//  获取PNG图片的大小
+(CGSize)getPNGImageSizeWithRequest:(NSMutableURLRequest*)request;
//  获取gif图片的大小
+(CGSize)getGIFImageSizeWithRequest:(NSMutableURLRequest*)request;
//  获取jpg图片的大小
+(CGSize)getJPGImageSizeWithRequest:(NSMutableURLRequest*)request;

//截屏
+ (UIImage *)getScreenshot;
@end
